{if $action}
{template 'header-widget', 'member'}
<!--[管理帖子]-->
{if $action == 'post'}
<div class="tt">
<form action="?">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="job" value="{$job}"/>
<input type="hidden" name="gid" value="{$gid}"/>
<input type="hidden" name="action" value="{$action}"/>
{$fields_select}&nbsp;
<input type="text" size="50" name="kw" value="{$kw}" title="关键词"/>&nbsp;
<input type="checkbox" name="level" value="1"{if $level} checked{/if}/>精华&nbsp;
<input type="checkbox" name="style" value="1"{if $style} checked{/if}/>高亮&nbsp;
<input type="checkbox" name="ontop" value="1"{if $ontop} checked{/if}/>置顶&nbsp;
<input type="checkbox" name="thumb" value="1"{if $thumb} checked{/if}/>图片&nbsp;
<input type="checkbox" name="guest" value="1"{if $guest} checked{/if}/>游客&nbsp;
<input type="submit" value=" 搜 索 " class="btn"/>
<input type="button" value=" 重 置 " class="btn" onclick="Go('?mid={$mid}&job={$job}&action={$action}&gid={$gid}');"/>
</form>
</div>
<form method="post">
<div class="ls">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th>
<th width="25"></th>
<th>标题</th>
<th>作者</th>
<th width="120">发表时间</th>
<th>人气</th>
<th>回复</th>
<th width="40">修改</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td><input type="checkbox" name="itemid[]" value="{$v[itemid]}"{if $itemid==$v[itemid]} checked{/if}/></td>
<td>
{if $v[ontop]}
<img src="{DT_SKIN}image/club_ontop_{$v[ontop]}.gif" alt="" title="{if $v[ontop]==1}本圈{else}全局{/if}置顶"/>
{elseif $v[level]}
<img src="{DT_SKIN}image/club_level_{$v[level]}.gif" alt="" title="精华{$v[level]}"/>
{elseif $v[thumb]}
<img src="{DT_SKIN}image/club_thumb.gif" alt="" title="有图片"/>
{elseif $v[video]}
<img src="{DT_SKIN}image/club_video.gif" alt="" title="有视频"/>
{else}
&nbsp;
{/if}
</td>
<td align="left" title="{$v[alt]}"><a href="{$v[linkurl]}" target="_blank" class="t">{$v[title]}</a>{if $v[status]==1 && $v[note]} <a href="javascript:" onclick="alert('{$v[note]}');"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/why.gif" title="未通过原因"/></a>{/if}</td>
<td><a href="{userurl($v[username])}" target="_blank">{$v[username]}</a></td>
<td class="f_gray px11">{$v[adddate]}</td>
<td class="f_gray px11">{$v[hits]}</td>
<td class="f_gray px11">{$v[reply]}</td>
<td>
<a href="?mid={$mid}&job={$job}&gid={$gid}&action=edit&itemid={$v[itemid]}"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="修改" alt=""/></a>
</td>
</tr>
{/loop}
</table>
</div>
<div class="btns">
<span class="f_r">
<select name="level" onchange="this.form.action='?mid={$mid}&job={$job}&gid={$gid}&action=level';this.form.submit();"><option value="0">加精</option><option value="0">取消</option><option value="1">精华1</option><option value="2">精华2</option><option value="3">精华3</option></select>

<select name="style" onchange="this.form.action='?mid={$mid}&job={$job}&gid={$gid}&action=style';this.form.submit();"><option value="0">高亮</option><option value="0">取消</option><option value="red">红色</option><option value="blue">蓝色</option><option value="orange">橙色</option></select>

<select name="ontop" onchange="this.form.action='?mid={$mid}&job={$job}&gid={$gid}&action=ontop';this.form.submit();"><option value="0">置顶</option><option value="0">取消</option><option value="1">本圈置顶</option></select>

<input type="submit" value=" 删除选中 " class="btn" onclick="if(confirm('确定要删除选中帖子吗？')){this.form.action='?mid={$mid}&job={$job}&gid={$gid}&action=delete'}else{return false;}"/>
</span>
<table>
<tr>
<td><span class="{if $MOD[manage_reason]}f_red{else}dsn{/if}">*</span></td>
<td><textarea style="width:300px;height:16px;" name="reason" id="reason" onfocus="if(this.value=='操作原因')this.value='';">操作原因</textarea></td>
<td><select onchange="if(this.value)Dd('reason').value=this.value;">
<option value="">常用原因</option>
{loop $REASON $v}
<option value="{$v}">{$v}</option>
{/loop}
</select></td>
<td><input type="checkbox" name="message" id="message" value="1"{if $MOD[manage_message]} checked{/if}{if $MOD[manage_message]==2} disabled{/if}/><label for="message"> 通知作者</label></td>
</tr>
</table>
</div>
</form>
<div class="pages">{$pages}</div>
<!--[编辑帖子]-->
{elseif $action == 'edit'}
<form method="post" action="?" id="dform" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="job" value="{$job}"/>
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="gid" value="{$gid}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellpadding="6" cellspacing="1" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> 帖子标题</td>
<td class="tr"><input name="post[title]" type="text" id="title" size="60" value="{$title}"/> <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">标题图片</td>
<td class="tr"><input name="post[thumb]" id="thumb" type="text" size="60" value="{$thumb}" readonly/>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="Dthumb({$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb').value, true);" class="t">[上传]</a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="_preview(Dd('thumb').value);" class="t">[预览]</a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="Dd('thumb').value='';" class="t">[删除]</a></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 帖子内容</td>
<td class="tr"><textarea name="post[content]" id="content" class="dsn">{$content}</textarea>
{deditor($moduleid, 'content', $group_editor, '100%', 350)}<br/><span id="dcontent" class="f_red"></span>
</td>
</tr>
{if $MOD[swfu] == 1 && DT_EDITOR == 'fckeditor' && !$DT_TOUCH}
{php include DT_ROOT.'/api/swfupload/editor.inc.php';}
{/if}
<tr>
<td class="tl">{if $MOD[manage_reason]}<span class="f_red">*</span> {/if}修改原因</td>
<td class="tr">
<table>
<tr>
<td><textarea style="width:300px;height:16px;" name="reason" id="reason" onfocus="if(this.value=='操作原因')this.value='';">操作原因</textarea></td>
<td><select onchange="if(this.value)Dd('reason').value=this.value;">
<option value="">常用原因</option>
{loop $REASON $v}
<option value="{$v}">{$v}</option>
{/loop}
</select></td>
<td><input type="checkbox" name="message" id="message" value="1"{if $MOD[manage_message]} checked{/if}{if $MOD[manage_message]==2} disabled{/if}/><label for="message"> 通知作者</label></td>
<td> <span id="dreason" class="f_red"></span></td>
</tr>
</table></td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 修 改 " class="btn_g"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="btn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
{load('clear.js')}
<script type="text/javascript">
function check() {
	var l;
	var f;
	f = 'title';
	l = Dd(f).value.length;
	if(l < 5 || l > 30) {
		Dmsg('标题应为5-30字，当前已输入'+l+'字', f);
		return false;
	}
	f = 'content';
	l = FCKLen();
	if(l < 15 || l > 50000) {
		Dmsg('内容应为15-50000字，当前已输入'+l+'字', f);
		return false;
	}
}
</script>
<!--[管理回复]-->
{elseif $action == 'reply'}
<div class="tt">
<form action="?">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="job" value="{$job}"/>
<input type="hidden" name="gid" value="{$gid}"/>
<input type="hidden" name="tid" value="{$tid}"/>
{$fields_select}&nbsp;
<input type="text" size="50" name="kw" value="{$kw}" title="关键词"/>&nbsp;
<input type="submit" value=" 搜 索 " class="btn"/>
<input type="button" value=" 重 置 " class="btn" onclick="Go('?mid={$mid}&job={$job}&action={$action}&gid={$gid}&tid={$tid}');"/>
</form>
</div>
<form method="post">
<div class="ls">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th>
<th>内容</th>
<th>作者</th>
<th width="150">回复时间</th>
<th width="40">修改</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td><input type="checkbox" name="itemid[]" value="{$v[itemid]}"{if $itemid==$v[itemid]} checked{/if}/></td>
<td align="left">&nbsp;&nbsp;<a href="{$v[linkurl]}" class="t" target="_blank" title="{$v[alt]}">{$v[title]}</a>&nbsp;&nbsp;</td>
<td><a href="{userurl($v[username])}" target="_blank">{$v[username]}</a></td>
<td class="f_gray px11">{$v[adddate]}</td>
<td>
<a href="?mid={$mid}&job={$job}&gid={$gid}&action=reply_edit&itemid={$v[itemid]}"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="修改" alt=""/></a>
</td>
</tr>
{/loop}
</table>
</div>
<div class="btns">
<span class="f_r">
<input type="submit" value=" 删除选中 " class="btn" onclick="if(confirm('确定要删除选中回复吗？')){this.form.action='?mid={$mid}&job={$job}&gid={$gid}&action=reply_delete'}else{return false;}"/>
</span>
<table>
<tr>
<td><span class="{if $MOD[manage_reason]}f_red{else}dsn{/if}">*</span></td>
<td><textarea style="width:300px;height:16px;" name="reason" id="reason" onfocus="if(this.value=='操作原因')this.value='';">操作原因</textarea></td>
<td><select onchange="if(this.value)Dd('reason').value=this.value;">
<option value="">常用原因</option>
{loop $REASON $v}
<option value="{$v}">{$v}</option>
{/loop}
</select></td>
<td><input type="checkbox" name="message" id="message" value="1"{if $MOD[manage_message]} checked{/if}{if $MOD[manage_message]==2} disabled{/if}/><label for="message"> 通知作者</label></td>
</tr>
</table>
</div>
</form>
<div class="pages">{$pages}</div>
<!--[编辑回复]-->
{elseif $action == 'reply_edit'}
<form method="post" action="?" id="dform" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="job" value="{$job}"/>
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="gid" value="{$gid}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellpadding="6" cellspacing="1" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> 回复内容</td>
<td class="tr"><textarea name="post[content]" id="content" class="dsn">{$content}</textarea>
{deditor($moduleid, 'content', $group_editor, '100%', 350)}<br/><span id="dcontent" class="f_red"></span>
</td>
</tr>
{if $MOD[swfu] == 1 && DT_EDITOR == 'fckeditor' && !$DT_TOUCH}
{php include DT_ROOT.'/api/swfupload/editor.inc.php';}
{/if}
<tr>
<td class="tl">{if $MOD[manage_reason]}<span class="f_red">*</span> {/if}修改原因</td>
<td class="tr"><table>
<tr>
<td><textarea style="width:300px;height:16px;" name="reason" id="reason" onfocus="if(this.value=='操作原因')this.value='';">操作原因</textarea></td>
<td><select onchange="if(this.value)Dd('reason').value=this.value;">
<option value="">常用原因</option>
{loop $REASON $v}
<option value="{$v}">{$v}</option>
{/loop}
</select></td>
<td><input type="checkbox" name="message" id="message" value="1"{if $MOD[manage_message]} checked{/if}{if $MOD[manage_message]==2} disabled{/if}/><label for="message"> 通知作者</label></td>
<td> <span id="dreason" class="f_red"></span></td>
</tr>
</table></td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 修 改 " class="btn_g"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="btn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
{load('clear.js')}
<script type="text/javascript">
function check() {
	var l;
	var f;
	f = 'content';
	l = FCKLen();
	if(l < 5 || l > 50000) {
		Dmsg('内容应为5-50000字，当前已输入'+l+'字', f);
		return false;
	}
}
</script>
{/if}
</body>
</html>
<!--[管理记录]-->
{else}
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="110" id="submenu"></td>
<td class="tab" id="manage"><a href="?mid={$mid}&job={$job}"><span>管理记录</span></a></td>
</tr>
</table>
</div>
<div class="tt">
<form action="?">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="job" value="{$job}"/>
{$fields_select}&nbsp;
<input type="text" size="30" name="kw" value="{$kw}" title="关键词"/>&nbsp;
<select name="typeid">
{loop $MANAGE $k $v}
<option value="{$k}"{if $k == $typeid} selected{/if}>{$v}</option>
{/loop}
</select>&nbsp;
<select name="message">
<option value="-1">通知</option>
<option value="1"{if $message==1} selected{/if}>已发</option>
<option value="0"{if $message==0} selected{/if}>未发</option>
</select>&nbsp;
<input type="submit" value=" 搜 索 " class="btn"/>
<input type="button" value=" 重 置 " class="btn" onclick="Go('?mid={$mid}&job={$job}');"/>
</form>
</div>
<div class="ls">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th>商圈</th>
<th>帖子/回复</th>
<th width="80">操作</th>
<th width="80">操作内容</th>
<th width="130">操作时间</th>
<th width="120">操作原因</th>
<th width="40">通知</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td><a href="{$v[groupurl]}" target="_blank">{$v[groupname]}</a></td>
<td align="left">&nbsp;<a href="{$v[linkurl]}" target="_blank" class="t">{$v[title]}</a></td>
<td>{if $v[rid]}回复{else}帖子{/if}{$MANAGE[$v[typeid]]}</td>
<td>{$v[value]}</td>
<td>{$v[adddate]}</td>
<td><textarea style="width:100px;height:16px;" title="{$v[reason]}">{$v[reason]}</textarea></td>
<td>{if $v[message]}<span class="f_green">已发</span>{else}<span class="f_red">未发</span>{/if}</td>
</tr>
{/loop}
</table>
</div>
<div class="pages">{$pages}</div>
<script type="text/javascript">s('mid_{$mid}');m('manage');</script>
{if $open_url}
<script type="text/javascript">
Dwidget('{$open_url}', '{$open_name}');
setInterval(function() {
	if(Dd('Dtop') == null) Go('?mid={$mid}&job={$job}&reload={$DT_TIME}');
}, 500);
</script>
{/if}
{/if}